import Home from './views/Home';
import Notes from './views/Notes';
import Say from './views/Say';
import About from './views/About';
import Detail from './views/Detail';
import Search from './views/Search';
import Login from './views/Login';
import Layout from './views/Layout';
import {routeInterface} from './router-type';
import {getNavRoutes} from './utils';
/**
 * 路由配置
 */
const routes: Array<routeInterface> = [
    {
        path: '/login',
        component: Login,
        meta: {
            name: '登录',
            nav: false,
        },
    },
    {
        path: '/',
        component: Layout,
        meta: {
            name: '首页',
            nav: false,
        },
        children: [
            {
                path: '/',
                exact: true,
                component: Home,
                meta: {
                    name: '首页',
                    nav: true,
                },
            },
            {
                path: '/notes',
                component: Notes,
                meta: {
                    name: '札记',
                    nav: true,
                },
            },
            {
                path: '/say',
                component: Say,
                meta: {
                    name: '一句话',
                    nav: true,
                },
            },
            {
                path: '/about',
                component: About,
                meta: {
                    name: '关于我',
                    nav: true,
                },
            },
            {
                path: '/detail',
                component: Detail,
                meta: {
                    name: '详情页',
                    nav: false,
                },
            },
            {
                path: '/search',
                component: Search,
                meta: {
                    name: '搜索',
                    nav: false,
                },
            },
        ],
    },
];

export const navRoutes = getNavRoutes(routes);

export default routes;
